package com.design.responsibility.demo2;

public class ChainOfResponsibilityLogDemo {
    public static void main(String[] args) {
        LogHandler consoleHandler = new ConsoleLogHandler();
        LogHandler fileHandler = new FileLogHandler();
        LogHandler databaseHandler = new DatabaseLogHandler();

        consoleHandler.setNextHandler(fileHandler);
        fileHandler.setNextHandler(databaseHandler);

        consoleHandler.handleLog("Console log message", LogLevel.CONSOLE);
        consoleHandler.handleLog("File log message", LogLevel.FILE);
        consoleHandler.handleLog("Database log message", LogLevel.DATABASE);
    }
}
